Repository navigation
feat(record): write only the unique id selector for recorded steps - #4733
Conversation
A recorded element step whose id is unique in the record-time tree now writes `id="..."` alone instead of the full `||` fallback chain. Steps without a unique id keep the existing chain. The drag recorder uses the same helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready at c0bce3c. CI is green (19 checks, none failing), and there are no conflicts. The writer, drag and replay-resolution routes read correctly, and the iOS save-and-replay test and the CI device lanes cover the lone-id replay. Not blocking, and you can take or leave these: a record-unique id that is duplicated in the replay tree no longer falls through to role+label for |
Summary
A recorded element step whose id is unique on the recorded screen now writes only
id="...". Other steps keep the existing||chain. Before:press 'id="x" || role="button" label="Go" || label="Go"'. After:press 'id="x"'. No flag. 13 files changed.The new
recordedSelectorExpressionhelper lives in@agent-device/selectors. The script writer and the drag recorder both call it.buildSelectorChainForNodeitself is unchanged, so the chain shown in resolution disclosure and divergence suggestions stays the same. Docs updated:help scripting,replay-e2e.md,commands.md(drag), andtarget-annotation.md.Safety check: I found no consumer that depends on the alternatives after a unique id.
target-v1: "A recordedidnever matches a node without that id" (target-annotation.mdLocal identity). So falling through tolabel=already ends inidentity-mismatch.fill --record-asdrops its evidence): the fall-through was a silent re-bind (rejected by ADR 0012).wait/isrecord the selector the user wrote, not this chain.null(unsupported). A lone id now exports.Validation
pnpm check:affected --runat c0bce3c: all runnable checks passed. CI covers the device lanes.android:id/titlegives the chain without the id, and no id gives the chain. The unique-id case fails when the writer change is reverted. The drag and iOS save/replay tests now pin the lone-id line exactly.🤖 Generated with Claude Code